<section class="header clearfix">
  <div class="pull-left">
    {{#if editing}}
      <h1>{{t 'podSecurityPoliciesPage.editPodSecurityPolicy'}}</h1>
    {{else if readOnly}}
      <h1>{{t 'podSecurityPoliciesPage.detail.header'}}: {{model.name}}</h1>
    {{else}}
      <h1>{{t 'podSecurityPoliciesPage.addPodSecurityPolicy'}}</h1>
    {{/if}}
  </div>
</section>

{{#if (and readOnly model.description)}}
  <div class="row mb-30">
    {{banner-message color='bg-secondary mb-0 mt-10' message=(linkify model.description)}}
  </div>
{{/if}}

{{#unless readOnly}}
  <section class="horizontal-form container-fluid">
    {{form-name-description
        model=model
        nameRequired=false
        namePlaceholder="podSecurityPoliciesPage.new.form.name.placeholder"
    }}
  </section>
{{/unless}}

<section>
  {{#accordion-list as |al expandFn|}}
    <div class="mt-20">
      {{form-basic-policy
        model=model
        expandAll=al.expandAll
        expandFn=expandFn
        readOnly=readOnly
      }}
    </div>

    <div class="mt-20">
      {{form-capability-policy
        model=model
        expandAll=al.expandAll
        expandFn=expandFn
        readOnly=readOnly
      }}
    </div>

    <div class="mt-20">
      {{form-volume-policy
        model=model
        expandAll=al.expandAll
        expandFn=expandFn
        readOnly=readOnly
      }}
    </div>

    <div class="mt-20">
      {{form-hostpath-policy
        model=model
        expandAll=al.expandAll
        expandFn=expandFn
        readOnly=readOnly
      }}
    </div>

    <div class="mt-20">
      {{form-fsgroup-policy
        model=model
        expandAll=al.expandAll
        expandFn=expandFn
        readOnly=readOnly
      }}
    </div>

    <div class="mt-20">
      {{form-hostports-policy
        model=model
        expandAll=al.expandAll
        expandFn=expandFn
        readOnly=readOnly
      }}
    </div>

    <div class="mt-20">
      {{form-runasuser-policy
        model=model
        expandAll=al.expandAll
        expandFn=expandFn
        readOnly=readOnly
      }}
    </div>

    <div class="mt-20">
      {{form-selinux-policy
        model=model
        expandAll=al.expandAll
        expandFn=expandFn
        readOnly=readOnly
      }}
    </div>

    <div class="mt-20">
      {{form-supplementalgroups-policy
        model=model
        expandAll=al.expandAll
        expandFn=expandFn
        readOnly=readOnly
      }}
    </div>

    <div class="mt-20">
      {{form-labels-annotations
        labelErrors=labelErrors
        initialLabels=model.labels
        setLabels=(action 'setLabels')
        expandAll=al.expandAll
        expandFn=expandFn
        model=model
      }}
    </div>

  {{/accordion-list}}
</section>


{{top-errors errors=errors}}

{{#unless readOnly}}
  {{save-cancel editing=editing  save="save" cancel="cancel"}}
{{/unless}}
